{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 设置参数，不需要重定尺寸的话resize可不填"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from Download import download\n",
    "keyWord = \"电子琴\"#关键词\n",
    "imgNumber = 10#数量\n",
    "resize = (64,64)#重定尺寸，若不填则维持原尺寸"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 调用函数下载图片，图片文件夹保存在Download.py同级目录，图片名是md5组成，所以不会有重复"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "key:电子琴 goal:10 finish:1\n",
      "key:电子琴 goal:10 finish:2\n",
      "key:电子琴 goal:10 finish:3\n",
      "key:电子琴 goal:10 finish:4\n",
      "key:电子琴 goal:10 finish:5\n",
      "key:电子琴 goal:10 finish:6\n",
      "key:电子琴 goal:10 finish:6\n",
      "key:电子琴 goal:10 finish:7\n",
      "key:电子琴 goal:10 finish:8\n",
      "key:电子琴 goal:10 finish:9\n",
      "key:电子琴 goal:10 finish:10\n"
     ]
    }
   ],
   "source": [
    "download(keyWord,imgNumber,resize)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 结果展示 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<img src=\"example.png\">"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%html\n",
    "<img src=\"example.png\">"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
